// @ts-ignore
/* eslint-disable */
import { request } from "@umijs/max";

/** 此处后端没有提供注释 POST /chat/completion */
export async function chatCompletion(
  body: API.ChatCompletionQuery,
  options?: { [key: string]: any }
) {
  return request<string>("/chat/completion", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /chat/completion/stream */
export async function streamChat(
  body: API.ChatCompletionQuery,
  options?: { [key: string]: any }
) {
  return request<string[]>("/chat/completion/stream", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
